package park.gz.com.parkingfee.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Menu;

import park.gz.com.parkingfee.R;
import park.gz.com.parkingfee.until.ShareUtil;


public class SplashActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);



        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Log.i("duzhijuan",ShareUtil.getstringvalue(SplashActivity.this,MyAppcation.userName));
                if("".equals(ShareUtil.getstringvalue(SplashActivity.this,MyAppcation.userName))||ShareUtil.getstringvalue(SplashActivity.this,MyAppcation.userName).equals("-1")) {
                    startActivity(new Intent(getApplicationContext(), MainActivity.class));
                }else {
                    startActivity(new Intent(getApplicationContext(), ParkActivity.class));
                }
                finish();
            }
        }, 2000);


    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.splash_screen, menu);
        return true;
    }
}
